/**
 * 字体大小
 * */
const fontSizeArr = [12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 42]
const fontSize = {}
fontSizeArr.forEach(val => {
    fontSize[val] = `${val}px`
})

/**
 * 圆角边框
 * */
const borderArr = [2, 4, 6, 8, 10, ...fontSizeArr]
const borderRadius = {}
borderArr.forEach(val => {
    borderRadius[val] = `${val}px`
})

/**
 * 字体粗细
 * */
const fontWeightArr = [100, 200, 300, 400, 500, 600, 700, 800, 900]
const fontWeight = {}
fontWeightArr.forEach(val => {
    fontWeight[val] = val
})

/**
 * 内边距
 * */
const spacingArr = [0, ...borderArr, 32, 34, 36, 38, 40, 50, 52, 54, 56, 58, 60]
const spacing = {}
spacingArr.forEach(val => {
    spacing[val] = `${val}px`
})

// 色彩
const colors = {
    primary: '#FB7F30',
    secondary: '#F6863F',
    page: '#FDFDFD',
    success: '#6EB33C',
    warning: '#F31111',
    error: '#FFA33E',
    white: '#FFFFFF',
    black: '#000000',
    't-title': '#262626',
    't-default': '#595959',
    't-secondary': '#8C8C8C',
    't-disabled': '#BFBFBF',
    't-border': '#D9D9D9'
}

module.exports = {
    content: ['./index.html', './src/**/*.{vue,js,ts}'],
    theme: {
        extend: {
            fontWeight: ['hover', 'focus']
        },
        borderRadius: {
            ...borderRadius,
            full: '50%'
        },
        minWidth: {
            page: '1200px'
        },
        letterSpacing: {
            5: '5px'
        },
        cursor: {
            pointer: 'pointer'
        },
        colors,
        textColor: colors,
        fontSize,
        fontWeight,
        spacing,
        backgroundColor: theme => ({ ...theme('colors') })
    },
    plugins: [],
    // 禁用不使用的功能
    corePlugins: {
        fontFamily: false,
        // 关闭 tailwind 预设样式，复制一份文件引入，删除 button 相关的背景色影响
        preflight: false
    }
}
